package controller;

import javax.swing.JTextField;

import view.AppView;

public class InputWordListener extends TwoTypeListener {

	private JTextField input;

	public InputWordListener(JTextField input, AppView view)
	{
		super(view);
		this.input = input;
	}

	@Override
	protected void myAction()
	{
		String response = input.getText();
		boolean isCorrect = model.checkAnswer(response);
		if(isCorrect)
		{
			model.nextWord();
		}
		refresh();
	}
}